<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('生成【请填写功能名称】')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-store-edit" th:object="${wmsStore}">
            <input name="sid" th:field="*{sid}" type="hidden">
            <div class="form-group">    
                <label class="col-sm-3 control-label">货物名称：</label>
                <div class="col-sm-8">
                    <input name="sname" th:field="*{sname}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">进货数量：</label>
                <div class="col-sm-8">
                    <input name="snum" th:field="*{snum}" class="form-control" type="text" id="jinhuo_num">
                    <span id="num_msg"></span>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script type="text/javascript">
        var prefix = ctx + "jinhuo/store";
        $("#form-store-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-store-edit').serialize());
            }
        }
        //效验进货数量
        $(function () {
            var  numStart = $("#jinhuo_num").val();
            /*$("#jinhuo_num").blur(function () {
                alert(numStart);
                if ($("#jinhuo_num").val()<numStart){
                    $("#num_msg").html("数量达不到库存充足,比"+numStart+"多才能达到充足").css("color","yellow");
                }else {
                    $("#num_msg").html("数量符合").css("color","green");
                }
            })*/
            $("#num_msg").html("进货数量达到"+numStart+"才能达到库存充足").css("color","green");
        })
    </script>
</body>
</html>